class MatchesController < ApplicationController
  skip_before_filter :ensure_authenticated_to_facebook,:update_friends,:only=>:index

  def index
    @most_comment_matches = Match.all(:limit=>SETTINGS['rss.size'],:order=>"comment_count desc",:include=>[:home_team,:away_team])
    @most_bet_matches = Match.all(:limit=>SETTINGS['rss.size'],:order=>"bets_count desc",:include=>[:home_team,:away_team])
    if params[:type] == "2"
      @recent_matches = Match.all :limit=>SETTINGS['rss.size'],:order=>"id desc",:include=>[:home_team,:away_team]
    else
      @recent_matches = []
    end

    respond_to do |format|
      format.rss
      format.atom { render :layout=>false }
      format.fbml
      format.html
    end
  end

  def show
    @match = Match.find params[:id]
  end

end
